import { splitToLength, BoolStrWithBoolen } from '../../Utils/common'
export function cnDialectical(data) {
  const {
    attr66,
    attr67,
    attr68,
    attr235,
    attr69,
    attr70,
    attr71,
    attr72,
    attr73,
    attr320,
    attr74,
    attr75,
    attr76,
    attr77,
    attr78,
    attr79,
    attr80,
    attr81,
    attr82,
    attr83,
    attr84,
    attr85,
    attr86,
    attr87,
    attr88,
    attr89,
    attr90,
    attr91,
    attr92,
    attr93,
    attr94,
  } = data
  let str = ''
  // if (attr66) str += '患者有咳嗽'
  // if (attr66 && attr67) str += `，咳嗽${attr67}`
  str += attr66And67(attr66, attr67)
  if (attr68) str += `，晨起${BoolStrWithBoolen(attr68) ? '有' : '没有'}咳嗽`
  // if (attr235) str += `，咳痰`
  // if (attr69) str += `${attr69}。`
  str += attr235And69(attr235, attr69)
  if (attr70) str += `，${BoolStrWithBoolen(attr70) ? '有' : '没有'}心烦`

  if (attr71) str += `，晨起${BoolStrWithBoolen(attr71) ? '有' : '没有'}痰鸣`

  str += attr72And73(attr72, attr73)

  if (attr320) str += `，${BoolStrWithBoolen(attr320) ? '有' : '没有'}发热`

  str += attr74And75(attr74, attr75)

  if (attr76) str += `，四肢${BoolStrWithBoolen(attr76) ? '温暖' : '不温暖'}`

  if (attr77) str += `，手足心${attr77}`

  if (attr78)
    str += `，患者${BoolStrWithBoolen(attr78) ? '有畏寒' : '没有畏寒'}`

  if (attr79) str += `，${BoolStrWithBoolen(attr79) ? '有乏力' : '没有乏力'}`

  if (attr80)
    str += `，${BoolStrWithBoolen(attr80) ? '有易感冒情况' : '无易感冒情况'}`

  if (attr81)
    str += `，${BoolStrWithBoolen(attr81) ? '有遇寒作嚏' : '遇寒没有作嚏'}`

  if (attr82) str += `，小便(${attr82})`

  if (attr83) str += `，大便${attr83}`

  if (attr84) str += `，${attr84}` // 寐可/夜卧不安

  if (attr85) str += `，饮食${attr85}`

  if (attr86) str += `，${attr86}`

  if (attr87) str += `，形体${attr87}`

  if (attr88) str += `，面色${attr88}`

  if (attr89)
    str += `，${BoolStrWithBoolen(attr89) ? '眼下有淤青' : '眼下无淤青'}`

  if (attr90) str += `，舌质${attr90}`

  if (attr91) str += `，舌苔${attr91}`

  if (attr92) str += `，脉${attr92}`

  if (attr93) str += `，指纹${attr93}`

  if (attr94) str += `。其他：${attr94}`
  return str
}

function attr74And75(attr74, attr75) {
  if (attr74 === '口渴' && attr75) {
    return `，干渴(${attr74}${attr75})`
  } else if (attr74) {
    return `，干渴(${attr74})`
  } else {
    return ''
  }
}
function attr72And73(attr72, attr73) {
  if (BoolStrWithBoolen(attr72) && attr73) {
    return `。患者有汗(${attr73})`
  } else if (BoolStrWithBoolen(attr72)) {
    return `。患者有汗`
  } else if (BoolStrWithBoolen(attr72) === false) {
    return '。患者没有汗'
  } else {
    return ''
  }
}

function attr66And67(attr66, attr67) {
  if (attr66 && attr67) {
    return `咳嗽${attr67}`
  } else if (attr66) {
    return `咳嗽`
  } else {
    return ``
  }
}

function attr235And69(attr235, attr69) {
  if (attr235 && attr69 && attr69.includes('咳痰')) {
    const tmp = attr69.replace('咳痰', '')
    return `，${attr235}(${tmp})`
  } else if (attr235 && attr69) {
    return `，${attr235}(${attr69})`
  } else if (attr235) {
    return `，${attr235}`
  } else {
    return ''
  }
}
